<?php
namespace app\index\controller;
use app\model\ArticleModel;
use app\model\CategoryModel;
use think\facade\View;

class api{
    public function api_list(){
        $category = CategoryModel::select();
        $arr = [];
        foreach($category as $row){
            $arr[] =$row;
        }
        $date = [
            'status'=> 404,
            'message' => '文件没了',
            'date' => $arr
        ];

        header("Content-Type: application/json");
        return json_encode($date,JSON_UNESCAPED_UNICODE);
    }
    public function api_html(){


        return View::fetch('api/api_list');
    }
}